package cn.edu.xmu.javaee.chapter2.dependencyinjection.bean;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

public class PaymentService {
    private final PayAdaptor payAdaptor;

    public PaymentService(@Qualifier("wePayAdaptor") PayAdaptor payAdaptor) {

        this.payAdaptor = payAdaptor;
    }

    @Override
    public String toString() {
        return "PaymentService{" +
                "adaptor=" + payAdaptor +
                '}';
    }
}
